<template>
  <div>
    <a-row>
      <a-col :offset="6" :span="8">
        <a-card title="新增价格组">
          <a-form v-bind="layout">
            <a-form-item label="名称" required="true" v-bind="validateInfos.name">
              <a-input v-model:value="addPriceGroupParam.name" />
            </a-form-item>

            <a-form-item :wrapper-col="{ span: 14, offset: 8 }">
              <a-button type="primary" @click="add">确定</a-button>
              <a-button style="margin-left: 30px" @click="resetFields">重置</a-button>
            </a-form-item>
          </a-form>
        </a-card>
      </a-col>
    </a-row>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { usePriceGroupAddFunctions } from '@/views/sale/price-group/add/index'

export default defineComponent({
  name: 'PriceGroupAdd',
  setup() {
    const { addPriceGroupParam, add, validateInfos, resetFields } = usePriceGroupAddFunctions()

    const layout = {
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
    }

    return {
      addPriceGroupParam,
      validateInfos,
      layout,
      add,
      resetFields,
    }
  },
})
</script>
